import 'package:flutter_test/flutter_test.dart';
import 'package:component_track_report/component_track_report.dart';
import 'package:component_track_report/component_track_report_platform_interface.dart';
import 'package:component_track_report/component_track_report_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockComponentTrackReportPlatform
    with MockPlatformInterfaceMixin
    implements ComponentTrackReportPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final ComponentTrackReportPlatform initialPlatform = ComponentTrackReportPlatform.instance;

  test('$MethodChannelComponentTrackReport is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelComponentTrackReport>());
  });

  test('getPlatformVersion', () async {
    ComponentTrackReport componentTrackReportPlugin = ComponentTrackReport();
    MockComponentTrackReportPlatform fakePlatform = MockComponentTrackReportPlatform();
    ComponentTrackReportPlatform.instance = fakePlatform;

    expect(await componentTrackReportPlugin.getPlatformVersion(), '42');
  });
}
